package com.xd.cloud.service.device;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xd.cloud.dao.device.TeamDao;
import com.xd.cloud.entity.core.Team;
import com.xd.cloud.entity.vehicle.VehicleInfo;

/**   
 * 功能描述：车队信息Service
 * @author: wangshanshan   
 * @date: 2017年12月14日 下午17:08:42 
 */
@Service
public class TeamService {

	@Autowired
	private TeamDao teamDao;
	
	public Team getTeamById(int id) {
		return teamDao.getTeamById(id);
	}
	
	public boolean save(Team item){
		teamDao.save(item);
		return true;
	}
	
	public boolean update(Team item){
		teamDao.update(item);
		return true;
	}
	
	public boolean deleteInfo(int id){
		Team item = teamDao.getTeamById(id);
		if(item!=null) {
			teamDao.delete(item);
			return true;
		}else{
			return false;
		}
	}
	
	public List<Team> getTeamByCompanyId(int company_id){
		return teamDao.getTeamByCompanyId(company_id);
	}
	
	public List<Object[]> getVehicleByCompanyId(int company_id){
		return teamDao.getVehicleByCompanyId(company_id);
	}
	public List<Object[]> getTeamVehicleByCompanyId(int company_id){
		return teamDao.getTeamVehicleByCompanyId(company_id);
	}	
}
